package cn.mastercom.gui.util;

import javax.swing.*;
import javax.swing.table.TableColumn;

public class GuiUtil {
	private GuiUtil() {
		throw new IllegalStateException("Utils class");
	}

	public static void hideTableColumn(JTable tb, int index) {
		TableColumn tc = tb.getColumnModel().getColumn(index);
		tc.setMinWidth(0);
		tc.setMaxWidth(0);
		tc.setPreferredWidth(0);
		tc.setWidth(0);
		tb.getTableHeader().getColumnModel().getColumn(index).setMaxWidth(0);
		tb.getTableHeader().getColumnModel().getColumn(index).setMinWidth(0);
	}

}
